package com.gitee.magic.converter;

import java.sql.Date;

import com.gitee.magic.core.converter.AbstractConverterEditor;

/**
 * @author start
 */
public class SqlDateConverterEditor extends AbstractConverterEditor<Date> {

	public SqlDateConverterEditor(Class<?> prototype) {
		super(prototype);
	}

	@Override
	public void restore(Object value) {
		if(value!=null) {
			setValue(Date.valueOf(String.valueOf(value)));
		}
	}

	@Override
	public Date converter() {
		if(getValue()!=null) {
			return (Date)getValue();
		}
		return null;
	}

}
